<?php
	$roomID = $_GET["roomName"];

	$con = mysql_connect("localhost","root","");
	if (!$con) {
		die('Could not connect: ' . mysql_error());
	}
	mysql_select_db("ciu196", $con);
	
	$sql = "
	SELECT COUNT(*) as count FROM StudentsInRooms
	WHERE roomID = '$roomID';
	";
	
	$res = mysql_query($sql,$con);	
	if(!$res) {
		die('Failed ' . mysql_error());
	}
	
	$count = mysql_fetch_row($res);
	echo "Student count: " . $count[0];
	
	mysql_close();
?>